import request from '@/utils/request'
/**
 * 获取所有的标签信息
 * @returns {AxiosPromise}
 */
export function fetchTagList() {
  return request({
    url: 'recruitment/tags',
    method: 'post'
  })
}

/**
 * 创建新的职位
 * @param query
 * @returns {AxiosPromise}
 */
export function createRecruitment(query) {
  return request({
    url: 'recruitment/create',
    method: 'post',
    params: query
  })
}

/**
 * 查看职位
 * @param query
 * @returns {AxiosPromise}
 */
export function viewRecruitment(query) {
  return request({
    url: 'recruitment/view',
    method: 'post',
    params: query
  })
}

/**
 * 根据条件查询职位列表
 * @param query
 * @returns {AxiosPromise}
 */
export function fetchRecruitmentList(query) {
  return request({
    url: 'recruitment/get',
    method: 'post',
    params: query
  })
}

/**
 * 更新职位信息
 * @param query
 * @returns {AxiosPromise}
 */
export function updateRecruitment(query) {
  return request({
    url: 'recruitment/update',
    method: 'post',
    params: query
  })
}

/**
 * 删除职位
 * @param query
 * @returns {AxiosPromise}
 */
export function deleteRecruitment(query) {
  return request({
    url: 'recruitment/delete',
    method: 'post',
    params: query
  })
}

/**
 * 批量删除职位
 * @param query
 * @returns {AxiosPromise}
 */
export function deleteRecruitmentList(query) {
  return request({
    url: 'recruitment/deleteList',
    method: 'post',
    params: query
  })
}

/**
 * 获取职位列表
 * @param query
 * @returns {AxiosPromise}
 */
export function getRecruitmentOptions() {
  return request({
    url: 'recruitment/option',
    method: 'post'
  })
}
